﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BitmapTagger
{
	/// <summary>
	/// Static class used for checking the extension of files
	/// </summary>
	public static class ExtensionChecker
	{
		/// <summary>
		/// Check if a extension is a JPEG extension
		/// </summary>
		/// <param name="extension">The extension to check if it is JPEG</param>
		/// <returns>True if it is a JPEG extension, false if not</returns>
		public static bool IsJPEGExtension(string extension)
		{
			var normalized = extension.ToLower();

			if (normalized.Equals(".jpg") ||
				normalized.Equals(".jpeg") ||
				normalized.Equals(".jpe") ||
				normalized.Equals(".jif") ||
				normalized.Equals(".jfif") ||
				normalized.Equals(".jfi"))
			{
				return true;
			}

			return false;
		}

		/// <summary>
		/// Check if an extension is a PNG extension
		/// </summary>
		/// <param name="extension">The extension to check if it is PNG</param>
		/// <returns>Tru if it is a PNG extension, false if not</returns>
		public static bool IsPNGExtension(string extension)
		{
			var normalized = extension.ToLower();

			if (normalized.Equals(".png"))
				return true;
			return false;
		}
	}
}
